﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MaterPage/Site.Master" AutoEventWireup="true" CodeBehind="AnalysisXML.aspx.cs" Inherits="Js_Study.XML.AnalysisXML" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        var analysis = function (xml) {
            this.path = xml;
            this.xmlDoc = null;

            this.initXmlDoc = function () {
                if (window.ActiveXObject) {
                    this.xmlDom = new ActiveXObject("Microsoft.XMLDOM");
                    this.xmlDom.load(this.path);
                }
                else if (document.implementation && document.implementation.createDocument) {
                    var xmlhttp = new window.XMLHttpRequest();
                    xmlhttp.open("GET", this.path, false);
                    xmlhttp.send(null);
                    this.xmlDom = xmlhttp.responseXML;
                } else {
                    this.xmlDom = null;
                }
            }

            this.checkXmlDoc = function () {
                if (this.xmlDoc == null) {
                    return;
                } else {
                    this.initXmlDoc();
                }
            }
        }

        var s = new analysis("Data.xml");
        s.initXmlDoc();
    </script>
</asp:Content>
